/*
 * Created by JFormDesigner on Mon May 30 15:49:50 CST 2022
 */

package jw3.c7.view;

import jw3.c7.controller.AssetsController;


import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;

/**
 * @author Brainrain
 */
public class Depreciation extends JFrame {
    public Depreciation() {
        initComponents();
        this.setVisible(true);
        this.setSize(800,600);
    }
    private void c(String zj){
        Vector<String> heads=new Vector<String>();
        heads.add("不动产ID");
        heads.add("不动产名称");
        heads.add("资产原值");
        heads.add("预计净残值");
        heads.add("预计使用年限");
        heads.add("不动产年折旧额");

        DefaultTableModel dtm=new DefaultTableModel(data,heads);
        table1.setModel(dtm);
    }
    private void button1MouseClicked(MouseEvent e) {

    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        label1 = new JLabel();
        panel1 = new JPanel();
        scrollPane2 = new JScrollPane();
        table1 = new JTable();
        button1 = new JButton();
        label2 = new JLabel();
        comboBox1 = new JComboBox();

        //======== this ========
        setFont(new Font(Font.DIALOG, Font.PLAIN, 20));
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- label1 ----
        label1.setText("\u4e0d\u52a8\u4ea7\u6298\u65e7");
        label1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
        contentPane.add(label1);
        label1.setBounds(310, 5, 110, 40);

        //======== panel1 ========
        {
            panel1.setLayout(null);

            //======== scrollPane2 ========
            {
                scrollPane2.setViewportView(table1);
            }
            panel1.add(scrollPane2);
            scrollPane2.setBounds(0, 0, 650, 230);

            {
                // compute preferred size
                Dimension preferredSize = new Dimension();
                for(int i = 0; i < panel1.getComponentCount(); i++) {
                    Rectangle bounds = panel1.getComponent(i).getBounds();
                    preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                    preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                }
                Insets insets = panel1.getInsets();
                preferredSize.width += insets.right;
                preferredSize.height += insets.bottom;
                panel1.setMinimumSize(preferredSize);
                panel1.setPreferredSize(preferredSize);
            }
        }
        contentPane.add(panel1);
        panel1.setBounds(95, 155, 650, 230);

        //---- button1 ----
        button1.setText("\u67e5\u8be2");
        button1.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                button1MouseClicked(e);
            }
        });
        contentPane.add(button1);
        button1.setBounds(305, 70, 110, button1.getPreferredSize().height);

        //---- label2 ----
        label2.setText("\u8bf7\u9009\u62e9\u6298\u65e7\u7c7b\u578b");
        contentPane.add(label2);
        label2.setBounds(35, 77, 130, label2.getPreferredSize().height);
        contentPane.add(comboBox1);
        comboBox1.setBounds(165, 70, 135, comboBox1.getPreferredSize().height);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
        comboBox1.addItem("流动资产");
        comboBox1.addItem("长期资产");
        comboBox1.addItem("固定资产");
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JLabel label1;
    private JPanel panel1;
    private JScrollPane scrollPane2;
    private JTable table1;
    private JButton button1;
    private JLabel label2;
    private JComboBox comboBox1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
    private static Vector<Vector<Object>> data;
}
